home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 75 / MOBICLIC 75.ISO / pc / DATA / TCHATCHE / doggy75-84.cst / 00107_Script_gestion_drapeaux < prev    next >
Text File  |  2005-06-13  |  3KB  |  119 lines

  1. -- gestion des drapeaux
  2. property s, nom,dernierSon
  3. global langue, pistePremierDrapeau,pisteInfoBulle,laboActif,sonIntLangues
  4. global interLangues
  5.  
  6. on beginSprite me
  7.   s = me.SpriteNum
  8.   nom = sprite(s).member.name
  9.   LC = nom.char[nom.char.count]
  10.   if LC = "a" then pistePremierDrapeau = s
  11.   suff = suffixeLangue()
  12.   if LC = suff then
  13.     sprite(s).member = member("drapeau1" & LC)
  14.   else
  15.     sprite(s).member = member("drapeau0" & LC)
  16.   end if
  17. end
  18.  
  19. on MouseEnter me
  20.   if _movie.pauseState() then exit
  21.   if interLangues=0 then exit
  22.   if laboActif=1 then exit
  23.   if controleTcha02()=0 then exit
  24.   if sprite(s).member.name contains "drapeau1" then exit
  25.   
  26.   _player.cursor(280)
  27.   sprite(s).member = nom & "_1"
  28.   
  29.   -- affichage de l'info bulle correspondant au bouton
  30.   xH = sprite(s).locH - 120
  31.   xV = sprite(s).locV - 10
  32.   
  33.   nomBulle = "tBulleLangue" & nom.char[9] & "_" & suffixeLangue()
  34.   sprite(pisteInfoBulle).width = member(nomBulle).width
  35.   sprite(pisteInfoBulle).height = member(nomBulle).height
  36.   sprite(1+pisteInfoBulle).member = member(nomBulle)
  37.   _movie.updateStage()
  38.   
  39.   sprite(1+pisteInfoBulle).locH = xH
  40.   sprite(1+pisteInfoBulle).locV = xV
  41.   _movie.updateStage()
  42.   sprite(pisteInfoBulle).rect = sprite(1+pisteInfoBulle).rect + rect(0,0,0,2)
  43.   sprite(pisteInfoBulle).visible =1
  44.   sprite(1+pisteInfoBulle).visible =1
  45.   
  46.   -- jouer le son correspondant au bouton
  47.   if sound(3).status = 3 then exit
  48.   if sonIntLangues = 0 then exit
  49.   LBout = ["Drapeau0d","Drapeau0a","Drapeau0b","Drapeau0c"]
  50.   p = getPos(LBout,nom)
  51.   if p<>0 then nomSon = "bout" & string(p+6)
  52.   memSon = dernierSon
  53.   sound(4).volume = sound(3).volume
  54.   sound(4).playFile("@/sons_tchatche/" & nomSon & suffixeLangue())
  55.   dernierSon = memSon
  56. end
  57.  
  58. on mouseLeave
  59.   if _movie.pauseState() then exit
  60.   if interLangues=0 then exit
  61.   if laboActif=1 then exit
  62.   if controleTcha02()=0 then exit
  63.   _player.cursor(-1)
  64.   -- dissimulation des info bulles
  65.   sprite(pisteInfoBulle).visible=0
  66.   sprite(1+pisteInfoBulle).visible=0
  67.   
  68.   if sprite(s).member.name contains "drapeau1" then exit
  69.   sprite(s).member = nom
  70.   coupeSon 4
  71. end
  72.  
  73. on mouseUp me
  74.   if laboActif=1 then exit
  75.   if interLangues=0 then exit
  76.   if controleTcha02()=0 then exit
  77.   
  78.   _player.cursor(-1)
  79.   
  80.   -- dissimulation des info bulles
  81.   sprite(pisteInfoBulle).visible=0
  82.   sprite(1+pisteInfoBulle).visible=0
  83.   
  84.   lettreLangue = the last char of nom
  85.   L = ["a","b","c","d"]
  86.   langue = getPos(L,lettreLangue)
  87.   nomD = nom
  88.   put "1" into char 8 of nomD
  89.   sprite(s).member = nomD & "_2"
  90.   majDrapeaux
  91.   choixLangue
  92. end
  93.  
  94. on majDrapeaux
  95.   compteur=0
  96.   repeat with i = pistePremierDrapeau to pistePremierDrapeau+3
  97.     compteur = 1+compteur
  98.     if compteur<>langue then
  99.       nomD = sprite(i).member.name
  100.       if nomD contains "Drapeau" then
  101.         LC = nomD.char[9]
  102.         sprite(i).member = member("drapeau0" & LC)
  103.       end if
  104.     end if
  105.   end repeat
  106. end
  107.  
  108. -- empΩcher le chgt de langue pendant un jeu tcha02
  109. on controleTcha02
  110.   if _movie.name contains "02" then
  111.     if _movie.frame > label("0") and _movie.frame < label("fin") then
  112.       return 0
  113.     else
  114.       return 1
  115.     end if
  116.   else
  117.     return 1
  118.   end if
  119. end